home *** CD-ROM | disk | FTP | other *** search
- /* sdpakhdr.h - define all know data packets
- srpakhdr.h defines the hardware flags the rest of the
- packets are defined here.
-
-
- since a alap is odd length, it needs to expanded each time used
- Note that the ALAP fields and ddp fields (both short and long ddp)
- add up to an evan number of bytes. Therefore the ddp records
- can be included in other records and will align properly.
- */
- #define ALAP_fields \
- uint8 al_dest; /* who the packet is addressed to */ \
- uint8 al_src; /* where the packet is from */ \
- uint8 al_type; /* what kind of data follows */
-
- /* macro to load a ddp length field */
- #define ddplen(xxxx) ((xxxx.hlen <<8) + xxxx.llen)
-
- /* define a DDP short header */
- struct DDP_short_R {
- ALAP_fields /* alap, dst,src, type */
- uint8 zro:6, /* reserved, must be zero */
- hlen:2; /* high bits of ddp length */
- uint8 llen; /* low bits of ddp length */
- uint8 dst_sok; /* DDP destination socket */
- uint8 src_sok; /* DDP source socket */
- uint8 ty; /* DDP proticol type */
- };
- typedef struct DDP_short_R DDP_short;
-
- /* define a DDP long header */
- struct DDP_long_R {
- ALAP_fields /* alap, dst,src, type */
- uint8 zro:2, /* reserved, must be zero */
- hop:4, /* hop count */
- hlen:2; /* high bits of ddp length */
- uint8 llen; /* low bits of ddp length */
- uint16 cks; /* network checksum */
- uint16 dst_net; /* destination network */
- uint16 src_net; /* source network */
- uint8 dst_nod; /* destination node id */
- uint8 src_nod; /* source node id */
- uint8 dst_sok; /* DDP destination socket */
- uint8 src_sok; /* DDP source socket */
- uint8 ty; /* DDP proticol type */
- };
- typedef struct DDP_long_R DDP_long;
-
- struct sdpakhdr_R {
- union {
- DDP_short sddp;
- DDP_long lddp;
- } xddp;
- };
- typedef struct sdpakhdr_R sdpakhdr;
-